<template>
	<header class="container-fluid top-header">
		<div @click="back" class="top-back"><i class="fa fa-angle-left fa-2x"></i><span>返回</span></div>
		<div class="top-more"><i class="fa fa-ellipsis-h fa-2x"></i></div>
	</header>
</template>

<script>
	export default {
		props: ['pName'],
		data() {
			return {

			}
		},
		methods: {
			//返回
			back() {
				if(this.pName == 'index') {
					return;
				}
				if(this.pName == 'user') {
					this.$router.push({
						path: '/user_center'
					});
					return;
				}
				if(this.pName == 'article') {
					this.$router.push({
						path: '/'
					});
					return;
				}
				if(this.pName == 'login') {
					this.$router.push({
						path: '/'
					});
					return;
				}
				if(this.pName == 'setting') {
					this.$router.push({
						path: '/brace_home',
						query: {
							pName: 'article'
						}
					});
					return;
				}
				if(this.pName == 'newBrace') {
					var cid = localStorage.getItem('cid');
					this.$router.push({
						name: 'SeleteBrace',
						params: {
							cid
						}
					});
					return;
				}
				this.$router.back(-1);
			}
		}
	}
</script>